package org.trader.proj.Util;
//这是我写的分页毕设的时候已经用过了，没有问题，具体到时候再说吧
import java.util.ArrayList;
import java.util.List;


public class pageBean {
		public int curPage; //当前是第几页 
		public int maxPage; //一共有多少页 
		public int maxRowCount; //一共有多少行 
		public int rowsPerPage = 10; //每页多少行
		public int startPosition=0;
		public List data;
		
		public pageBean(){}
		
		public void setCurPage(int c){
			this.curPage = c;
		}
		
		public void setMaxPage(){ //根据总行数计算总页数  
	    	if (this.maxRowCount % this.rowsPerPage==0){
	       		this.maxPage = this.maxRowCount/this.rowsPerPage;
	    	}else{
	       		this.maxPage = this.maxRowCount/this.rowsPerPage + 1;    
	        }
	    }
	    
	    public void setMaxRowCount(int m){//传过来一个总记录行数参数
	    	this.maxRowCount = m;
		}
		
		public void setData(ArrayList a){
			this.data = a;
		}
		
		public int getCurPage(){
			return this.curPage;
		}
		
		public int getMaxPage(){
			return this.maxPage;
		}
		
		public int getMaxRowCount(){
			return this.maxRowCount;
		}
		
	    public List getData() {
			return data;
		}

		public void setData(List data) {
			this.data = data;
		}

		public int getRowsPerPage(){
	    	return this.rowsPerPage;
	    }

		public void setRowsPerPage(int rowsPerPage) {
			this.rowsPerPage = rowsPerPage;
		}
		
		public void setStartPosition(int startPosition) {
			this.startPosition = startPosition;
		}

		public int getStartPosition(){
			this.startPosition=(getCurPage()-1)*getRowsPerPage();
			return startPosition;
		} 
	}

